#include <REGX52.H>
#include "uart.c"
#include "game.h"
#include "display.c"
/**
 * 实现左右按键，通过左右按键实现数字的切换。
 * 0~9, 9+ = 0  0-=9
 */
sbit button_speedup = P1^5;
sbit button_speeddown = P1^4;
unsigned char speed = 8;   
 
void main()

{ unsigned  i;  
     i== 0;
    uart_init();
    display_init();
    display_speed_select_screen();
    display_speed_select_num(i);
    while(1){
    if(button_speedup==0){
        i++;
        if (i>9)i=0;

        display_speed_select_num(i);
    while(~button_speedup);
    }
    if(button_speeddown==0){
        i--;
        if(i<0||i>9)
        i=9;
        display_speed_select_num(i);
    while(~button_speeddown);
    }
}
    while (1)
    {
    }
}